<html>
<head>
<script type="text/javascript" src="../js/splender.js"></script>
</head>
<body>

<h1>C# Highlighting Tests</h1>

<h2>LINQ, Regex</h2>
<pre class="code-csharp">
var regex = new Regex(@"GET /ongoing/When/\d\d\dx/(\d\d\d\d/\d\d/\d\d/[^ .]+)");

var grouped = from line in ReadLinesFromFile("logfile.txt")
    let match = regex.Match(line)
    where match.Success
    let url = match.Value
    group url by url;

var ordered = from g in grouped
    let count = g.Count()
    orderby count descending
    select new { Count = count, Key = g.Key };

foreach (var item in ordered.Take(10)) {
    Console.WriteLine("{0}: {1}", item.Count, item.Key);
}
</pre>

<h2>String</h2>
<pre class="code-csharp">
Console.WriteLine ("Simple");
Console.WriteLine ("Escaped \"Quotes\"");
Console.WriteLine (@"Allow C:\");
Console.WriteLine ("An valid \"quote\"");
Console.WriteLine (@"A valid ""quote""");
Console.WriteLine (@"Woo some \ literals");
Console.WriteLine ("");
</pre>

</body>
</html>

